package jinyilw.common.math;

public class MPoint
{

	public double x = 0;
	public double y = 0;

	public MPoint()
	{
	}

	public MPoint(double x, double y)
	{
		this.x = x;
		this.y = y;
	}

	public void setPoint(double x, double y)
	{
		this.x = x;
		this.y = y;
	}

	public void rotate(double angle, double rX, double rY)
	{
		if (angle == 0)
			return;
		double xx = x - rX, yy = y - rY, cos = Math.cos(angle),
				sin = Math.sin(angle);
		x = rX + xx * cos - yy * sin;
		y = rY + xx * sin + yy * cos;
	}
}
